// 凭证明细表
const {DataTypes, db } = require("../db");
db.define('cardInfo', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
byIid:{type: DataTypes.INTEGER,defaultValue:0,comment:'原票据ID'}, 
buId:{type: DataTypes.INTEGER,defaultValue:0,comment:'辅助核算【供应商/客户】ID'}, 
zqId:{type: DataTypes.INTEGER,comment:'账期ID 结转凭证'}, 
cardId:{type: DataTypes.INTEGER,allowNull:false,comment:'主表ID'}, 
subjectId:{type: DataTypes.INTEGER,allowNull:false,defaultValue:0,comment:'科目ID'}, 
price1:{type: DataTypes.DECIMAL(18, 2),allowNull:false,defaultValue:0,comment:'借方金额'}, 
price2:{type: DataTypes.DECIMAL(18, 2),allowNull:false,defaultValue:0,comment:'贷方金额'}, 
isJz:{type: DataTypes.INTEGER,defaultValue:0,comment:'是结转凭证'}, 
toYs:{type: DataTypes.INTEGER,comment:'处理预收'}, 
remark:{type: DataTypes.STRING(500),defaultValue:(''),comment:'备注'}, 
billNo:{type: DataTypes.STRING(128),defaultValue:(''),comment:'票号'}, 
subjectCode:{type: DataTypes.STRING(100),defaultValue:(''),comment:'科目编码'}, 
fullName:{type: DataTypes.STRING(200),defaultValue:(''),comment:'科目全名'}, 
buName:{type: DataTypes.STRING(255),defaultValue:(''),comment:'往来单位名称'}, 
employeeName:{type: DataTypes.STRING(100),defaultValue:(''),comment:'员工名称'}, 
employeeId:{type: DataTypes.INTEGER,defaultValue:0,comment:'辅助核算【职员】'}, 
bz:{type: DataTypes.STRING(255),comment:''}, 
subjectName:{type: DataTypes.STRING(200),defaultValue:(''),comment:'科目名称'}, 

}, {
    tableName: 'card_info',
    timestamps: false,
    comment: '凭证明细表',
    
});